package cn.ilikes.tools.nosql.test.jpa.pojos;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import cn.ilikes.tools.nosql.jpa.annotations.Index;
import cn.ilikes.tools.nosql.jpa.annotations.IndexColumn;

@Entity
@Table(name = "pe_cycles", schema = "ilikes")
@Index
public class Cycles {

	@Id
	@IndexColumn(index = IndexColumn.Index.analyzed, name = "cycleId", store = IndexColumn.Store.yes)
	private int uuid;

	@Column(name = "cycles_name")
	@IndexColumn(index = IndexColumn.Index.analyzed, name = "cyclesName", store = IndexColumn.Store.yes)
	private String cyclesName;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cycles")
	private List<EmployeeGroup> employeeGroups = new ArrayList<EmployeeGroup>();

	public int getUuid() {
		return uuid;
	}

	public void setUuid(int uuid) {
		this.uuid = uuid;
	}

	public String getCyclesName() {
		return cyclesName;
	}

	public void setCyclesName(String cyclesName) {
		this.cyclesName = cyclesName;
	}

	public List<EmployeeGroup> getEmployeeGroups() {
		return employeeGroups;
	}

	public void setEmployeeGroups(List<EmployeeGroup> employeeGroups) {
		this.employeeGroups = employeeGroups;
	}

}